﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:local="clr-namespace:Kinect.Tests"

                    xmlns:animation="clr-namespace:System.Windows.Media.Animation;assembly=PresentationCore"
                    xmlns:sys="clr-namespace:System;assembly=mscorlib">

    <sys:Double x:Key="ToolHeight">85.0</sys:Double>
    <sys:Double x:Key="ToolWidth">120.0</sys:Double>

    <sys:Double x:Key="ToolExtendedHeight">135.0</sys:Double>
    <sys:Double x:Key="ToolExtendedWidth">170.0</sys:Double>

    <animation:KeyTime x:Key="FillAnimationLength">0:0:1.500</animation:KeyTime>
    <animation:KeyTime x:Key="FillAnimationLengthQuick">0:0:0.750</animation:KeyTime>

    <SolidColorBrush x:Key="asdfBrush" Color="#FF0C61B4" />

    <LinearGradientBrush x:Key="PrimaryBrush"  EndPoint="0.5,1" StartPoint="0.5,0">
        <GradientStop Color="#00FFFFFF" Offset="0"/>
        <GradientStop Color="#FF0C61B4" Offset="0"/>
        <GradientStop Color="#FF0C61B4" Offset="1"/>
    </LinearGradientBrush>
    
    <SolidColorBrush x:Key="SecondaryBrush" Color="White" />
    <SolidColorBrush x:Key="CanvasBackgroundBrush" Color="#FFE9E9E9" />

    <GridLength x:Key="ColumnWidth1">280</GridLength>

    <GridLength x:Key="ColumnWidth3">150</GridLength>


    <Style x:Key="KinectErrorTextStyle"
           TargetType="{x:Type TextBlock}">
        <Setter Property="Foreground"
                Value="Red" />
        <Setter Property="FontSize"
                Value="18" />
        <Setter Property="FontFamily"
                Value="Segoe UI" />
        <Setter Property="FontWeight"
                Value="Bold" />
        <Setter Property="Margin"
                Value="0,3,0,0" />
    </Style>

    <Style x:Key="LabelStyle"
           TargetType="{x:Type TextBlock}">
        <Setter Property="FontFamily"
                Value="Segoe UI Semibold" />
        <Setter Property="FontSize"
                Value="24" />
        <Setter Property="Foreground"
                Value="White" />
        <Setter Property="Margin"
                Value="15,0" />
        <Setter Property="TextWrapping"
                Value="Wrap" />
    </Style>

    <Style x:Key="BlackLabelStyle"
           TargetType="{x:Type TextBlock}">
        <Setter Property="FontFamily"
                Value="Segoe UI Semibold" />
        <Setter Property="FontSize"
                Value="24" />
        <Setter Property="Foreground"
                Value="Black" />
        <Setter Property="Margin"
                Value="15,0" />
        <Setter Property="TextWrapping"
                Value="Wrap" />
    </Style>

    <Style TargetType="{x:Type TextBlock}"
           x:Key="ToolLabelStyle">
        <Setter Property="HorizontalAlignment"
                Value="Left" />
        <Setter Property="VerticalAlignment"
                Value="Bottom" />
        <Setter Property="Margin"
                Value="5,0,0,5" />
        <Setter Property="FontFamily"
                Value="Segoe UI Semibold" />
        <Setter Property="FontSize"
                Value="20" />
        <Setter Property="Foreground"
                Value="{StaticResource SecondaryBrush}" />
    </Style>

    <Style TargetType="{x:Type TextBlock}"
           x:Key="ToolLabelStyleLarge">
        <Setter Property="HorizontalAlignment"
                Value="Left" />
        <Setter Property="VerticalAlignment"
                Value="Bottom" />
        <Setter Property="Margin"
                Value="5,0,0,5" />
        <Setter Property="FontFamily"
                Value="Segoe UI Semibold" />
        <Setter Property="FontSize"
                Value="50" />
        <Setter Property="Foreground"
                Value="{StaticResource SecondaryBrush}" />
    </Style>

    <Style x:Key="PopupMessageTextStyle"
           TargetType="{x:Type TextBlock}">
        <Setter Property="Foreground"
                Value="{StaticResource SecondaryBrush}" />
        <Setter Property="FontFamily"
                Value="Segoe WP Light" />
        <Setter Property="FontSize"
                Value="32" />
        <Setter Property="VerticalAlignment"
                Value="Top" />
        <Setter Property="HorizontalAlignment"
                Value="Left" />
        <Setter Property="TextAlignment"
                Value="Left" />
        <Setter Property="TextWrapping"
                Value="Wrap" />
        <Setter Property="Margin"
                Value="30,-12,0,0" />
    </Style>

    <Style x:Key="MessagePanelStyle"
           TargetType="{x:Type StackPanel}">
        <Setter Property="Margin"
                Value="35,0,0,0" />
        <Setter Property="VerticalAlignment"
                Value="Center" />
    </Style>

    <Style x:Key="RightButtonPanelStyle"
           TargetType="{x:Type Panel}">
        <Setter Property="HorizontalAlignment"
                Value="Left" />
        <Setter Property="Margin"
                Value="15,0,0,0" />
    </Style>

    <Style x:Key="ButtonIconStyle"
           TargetType="{x:Type Image}">
        <Setter Property="Width"
                Value="40" />
        <Setter Property="Height"
                Value="40" />
        <Setter Property="Stretch"
                Value="Uniform" />
        <Setter Property="VerticalAlignment"
                Value="Top" />
        <Setter Property="Margin"
                Value="0,15,0,0" />
    </Style>



    <Storyboard x:Key="StoryboardDummy" Duration="0:0:1.500" FillBehavior="Stop" >
    </Storyboard>

    <ControlTemplate x:Key="KinectButtonTemplate" TargetType="{x:Type Button}">
        <Grid RenderTransformOrigin="0.5,0.5">
            <Rectangle x:Name="ButtonBackground" Fill="{TemplateBinding Background}" Stroke="{TemplateBinding BorderBrush}" />
            <ContentPresenter />
            <TextBlock Text="{TemplateBinding Tag}" Style="{StaticResource ToolLabelStyle}" />
        </Grid>

        
    </ControlTemplate>

    <Style x:Key="KinectButtonStyle" TargetType="{x:Type local:KinectButtonBase}">
        <Setter Property="Width" Value="{StaticResource ToolWidth}" />
        <Setter Property="Height" Value="{StaticResource ToolHeight}" />
        <Setter Property="Background" Value="{StaticResource PrimaryBrush}" />
        <Setter Property="BorderBrush" Value="{x:Null}" />
        <Setter Property="Margin" Value="0,0,10,10" />
    </Style>
    
    

    <Style x:Key="KinectButtonTemplateStyle" TargetType="{x:Type Button}">
        <Setter Property="Width" Value="{StaticResource ToolExtendedWidth}" />
        <Setter Property="Height" Value="{StaticResource ToolExtendedHeight}" />
        <Setter Property="Template" Value="{StaticResource KinectButtonTemplate}" />
        <Setter Property="Background" Value="{StaticResource PrimaryBrush}" />
        <Setter Property="BorderBrush" Value="{x:Null}" />
        <Setter Property="Margin" Value="0,0,10,10" />
    </Style>

    <ControlTemplate x:Key="MetroButtonTemplate"
                     TargetType="{x:Type Button}">
        <Border BorderThickness="{TemplateBinding BorderThickness}"
                BorderBrush="{TemplateBinding BorderBrush}"
                Background="{TemplateBinding Background}">
            <ContentPresenter HorizontalAlignment="Center"
                              VerticalAlignment="Center"
                              Margin="0,0,0,6" />
        </Border>
    </ControlTemplate>

    <Style x:Key="MetroButtonStyle"
           TargetType="{x:Type Button}">
        <Setter Property="Width"
                Value="140" />
        <Setter Property="Height"
                Value="55" />
        <Setter Property="FontSize"
                Value="28" />
        <Setter Property="Background"
                Value="#00000000" />
        <Setter Property="BorderBrush"
                Value="{StaticResource SecondaryBrush}" />
        <Setter Property="Foreground"
                Value="{StaticResource SecondaryBrush}" />
        <Setter Property="BorderThickness"
                Value="3" />
        <Setter Property="Template"
                Value="{StaticResource MetroButtonTemplate}" />
        <Setter Property="FontFamily"
                Value="Segoe UI Semibold" />
    </Style>

    <Style x:Key="ToolItemStyle"
           TargetType="{x:Type ListBoxItem}">
        <Setter Property="Background"
                Value="{StaticResource PrimaryBrush}" />
        <Setter Property="Foreground"
                Value="{StaticResource SecondaryBrush}" />
        <Setter Property="Margin"
                Value="0,0,10,10" />

        <Style.Triggers>
            <Trigger Property="Selector.IsSelected"
                     Value="True">
                <Setter Property="Background"
                        Value="{StaticResource SecondaryBrush}" />
                <Setter Property="Foreground"
                        Value="{StaticResource PrimaryBrush}" />
            </Trigger>
        </Style.Triggers>
    </Style>

    <Style x:Key="ToolRootPanelStyle"
           TargetType="{x:Type Grid}">
        <Setter Property="Width"
                Value="{StaticResource ToolWidth}" />
        <Setter Property="Height"
                Value="{StaticResource ToolHeight}" />
    </Style>

    <Style x:Key="TutorialButtonTextStyle"
           TargetType="{x:Type TextBlock}">
        <Setter Property="Foreground"
                Value="White" />
        <Setter Property="TextWrapping"
                Value="Wrap" />
        <Setter Property="FontSize"
                Value="36" />
        <Setter Property="FontFamily"
                Value="Segoe UI Semibold" />
        <Setter Property="HorizontalAlignment"
                Value="Center" />
        <Setter Property="VerticalAlignment"
                Value="Center" />
    </Style>
    
    <ControlTemplate x:Key="BrushItemTemplate"
                     TargetType="{x:Type ListBoxItem}">
        <Grid Style="{StaticResource ToolRootPanelStyle}"
              Background="{TemplateBinding Background}">
            <Image x:Name="ImageUnselected"
                   Style="{StaticResource ButtonIconStyle}"
                   Source="{Binding Icon}" />

            <Image x:Name="ImageSelected"
                   Style="{StaticResource ButtonIconStyle}"
                   Source="{Binding IconSelected}"
                   Visibility="Collapsed" />

            <TextBlock Text="{Binding FriendlyName}"
                       Style="{StaticResource ToolLabelStyle}"
                       Foreground="{TemplateBinding Foreground}" />
        </Grid>

        <ControlTemplate.Triggers>
            <Trigger Property="Selector.IsSelected"
                     Value="True">
                <Setter Property="Visibility"
                        TargetName="ImageUnselected"
                        Value="Collapsed" />
                <Setter Property="Visibility"
                        TargetName="ImageSelected"
                        Value="Visible" />
            </Trigger>
        </ControlTemplate.Triggers>
    </ControlTemplate>

    <Style x:Key="BrushItemStyle"
           TargetType="{x:Type ListBoxItem}"
           BasedOn="{StaticResource ToolItemStyle}">
        <Setter Property="Template"
                Value="{StaticResource BrushItemTemplate}" />
    </Style>

    <ControlTemplate x:Key="BrushSizeItemTemplate"
                     TargetType="{x:Type ListBoxItem}">
        <Grid Style="{StaticResource ToolRootPanelStyle}"
              Background="{TemplateBinding Background}">
            <Rectangle Fill="{TemplateBinding Foreground}"
                       Width="70"
                       Height="1"
                       RenderTransformOrigin="0.5,0.5"
                       VerticalAlignment="Top"
                       Margin="0,35,0,0">
                <Rectangle.RenderTransform>
                    <ScaleTransform ScaleY="{Binding}" />
                </Rectangle.RenderTransform>
            </Rectangle>

            <TextBlock Text="{Binding StringFormat=\{0:N0\}}"
                       Style="{StaticResource ToolLabelStyle}"
                       Foreground="{TemplateBinding Foreground}" />
        </Grid>
    </ControlTemplate>

    <Style x:Key="BrushSizeItemStyle"
           TargetType="{x:Type ListBoxItem}"
           BasedOn="{StaticResource ToolItemStyle}">
        <Setter Property="Template"
                Value="{StaticResource BrushSizeItemTemplate}" />
    </Style>

    <Style x:Key="KinectCheckBoxTextStyle"
           TargetType="{x:Type TextBlock}">
        <Setter Property="FontFamily"
                Value="Segoe UI Semibold" />
        <Setter Property="FontSize"
                Value="40" />
        <Setter Property="Margin"
                Value="0,0,0,13" />
    </Style>

    <ControlTemplate x:Key="KinectCheckBoxTemplate"
                     TargetType="{x:Type CheckBox}">
        <Grid Background="{TemplateBinding Background}">
            <TextBlock x:Name="CheckedContent"
                       HorizontalAlignment="Center"
                       TextWrapping="Wrap"
                       Text="{TemplateBinding Content}"
                       VerticalAlignment="Center"
                       Style="{StaticResource KinectCheckBoxTextStyle}"
                       Foreground="{TemplateBinding Foreground}"
                       Visibility="Collapsed" />
            <TextBlock x:Name="UnecheckedContent"
                       HorizontalAlignment="Center"
                       TextWrapping="Wrap"
                       Text="{TemplateBinding Tag}"
                       VerticalAlignment="Center"
                       Style="{StaticResource KinectCheckBoxTextStyle}"
                       Foreground="{TemplateBinding Foreground}"
                       Visibility="Visible" />
        </Grid>

        <ControlTemplate.Triggers>
            <Trigger Property="IsChecked"
                     Value="True">
                <Setter Property="Visibility"
                        TargetName="CheckedContent"
                        Value="Visible" />
                <Setter Property="Visibility"
                        TargetName="UnecheckedContent"
                        Value="Collapsed" />
            </Trigger>
        </ControlTemplate.Triggers>
    </ControlTemplate>

    <Style x:Key="KinectCheckBoxStyle"
           TargetType="{x:Type CheckBox}">
        <Setter Property="Template"
                Value="{StaticResource KinectCheckBoxTemplate}" />
        <Setter Property="Width"
                Value="{StaticResource ToolWidth}" />
        <Setter Property="Height"
                Value="{StaticResource ToolHeight}" />
        <Setter Property="Background"
                Value="{StaticResource PrimaryBrush}" />
        <Setter Property="BorderBrush"
                Value="{x:Null}" />
        <Setter Property="Foreground"
                Value="{StaticResource SecondaryBrush}" />
        <Setter Property="HorizontalAlignment"
                Value="Left" />
        <Setter Property="Margin"
                Value="13,0,0,0" />

        <Style.Triggers>
            <Trigger Property="IsChecked"
                     Value="True">
                <Setter Property="Background"
                        Value="{StaticResource SecondaryBrush}" />
                <Setter Property="Foreground"
                        Value="{StaticResource PrimaryBrush}" />
            </Trigger>
        </Style.Triggers>
    </Style>
</ResourceDictionary>